import pandas as pd
import numpy as np

from PC import pc
from MLE import mle
from Bayesnet import read_bn
from Config import Config
from Feature import get_data

if __name__ == '__main__':

    config = Config()
    x_train, x_test, y_train, y_test = get_data(Config().DATA_PATH)
    
    # 合并特征和标签
    data_np = np.hstack((x_train, np.array([y_train]).T))
    # 转 DataFrame
    data = pd.DataFrame(data_np)

    bn = pc(data)
    mle(bn, data.values)

    bn.write_bn("IDS.bn")

    bn.plot(Config.LABEL)